﻿@{
    ViewBag.Title = "Details";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
@model MvcEnrollment.Models.Student
<h2>Details</h2> <h3 style="color:red">@TempData["SuccessMsg"]</h3>
<br />
@Html.ActionLink("All payments", "Index")
<br />
<br />
@if (!Model.Payment.PaymentOption.Equals("Full"))
{
    <a href ="/Dashboard/NextDetails/@Model.ID">
        <input type="button" value="Query Next Transaction" /></a>
    <a href ="/Dashboard/UpdateRebillEvent/@Model.ID">
        <input type="button" value="Update Rebill Event" /></a>
}
<br />
<br />

<carttitle>Student</carttitle>
<table class="nonEditableTable">
    <tr>
        <th>Name</th>
        <td>@Html.DisplayFor(model => model.FirstName) @Html.DisplayFor(model => model.LastName)</td>
        <th>Title</th>
        <td>@Html.DisplayFor(model => model.Title)</td>
    </tr>
    <tr>
        <th>Birthday</th>
        <td>@Html.DisplayFor(model => model.Birthday)</td>
        <th>Contact Number</th>
        <td>@Html.DisplayFor(model => model.Phone)</td>
    </tr>
    <tr>
        <th>Email</th>
        <td>@Html.DisplayFor(model => model.Email)</td>
        <th>Postcode</th>
        <td>@Html.DisplayFor(model => model.Postcode)</td>
    </tr>
    <tr>
        <th>Address</th>
        <td>@Html.DisplayFor(model => model.Address)</td>
        <td>@Html.DisplayFor(model => model.State)</td>
        <td>@Html.DisplayFor(model => model.Country)</td>
    </tr>
</table>
<br />
<carttitle>Course</carttitle>
<table class="nonEditableTable">
    <tr>
        <th>Course Name</th>
        <td>@Html.DisplayFor(model => model.Course.Name)</td>
        <th>Institution</th>
        <td>@Html.DisplayFor(model => model.Course.Provider)</td>
    </tr>
    <tr>
        <th>Installment Type</th>
        <td>@Html.DisplayFor(model => model.Payment.PaymentOption)</td>
        <th>Total Amount</th>
        <td>@Html.DisplayFor(model => model.Payment.TotalAmount)</td>
    </tr>
</table>
<br />
@{
    string tranIndex = "";
    var tranId = "";
    if (Model.Payment.PaymentOption.Equals("Full"))
    {
        tranIndex = "DirectTransaction";
        tranId = Model.Trxn;
    }
    else
    {
        tranIndex = "RecurringTransaction";
        tranId = Model.ID.ToString();
    }
}
@{Html.RenderAction(tranIndex, "Dashboard", new { id = tranId });}